import request from '@/utils/request'

// 获取分类id的数据
// export const getTopCategoryAPI = (id) => {
//   return request({
//     url: `/mall-product/product/get-products-by-category-id/${id}`,
//     method: 'GET'
//   })
// }
export const getTopCategoryAPI = (id) => {
  return request({
    url: `/mall-product/category/tree/${id}`,
    method: 'GET'
  })
}

// 分类数据获取
export const getBannerAPI = (categoryId) => {
  // 默认为1 商品为2
  return request({
    url: `/mall-product/banner/getBannersByCategoryId/${categoryId}`,
    method: 'GET'
  })
}
// 二级分类数据获取
export const getSubCategoryAPI = (id) => {
  return request({
    url: '/category/sub/filter',
    params: { id }
  })
}
// 根据分类id获取分类信息
export const getBySubCategoryAPI = (id) => {
  return request({
    url: `/mall-product/category/sub/${id}`,
    method: 'GET'
  })
}
// 根据分类id获取商品信息分类基础列表数据获取
export const getSubCategoryListAPI = (id) => {
  return request({
    url: `/mall-product/category/subGoods/${id}`,
    method: 'GET'
  })
}
